﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="en">

<head>
    <jsp:include page="/common.jsp"></jsp:include>
</head>

<body class="navbar-top">
<div class="modal-shiftfix">
    <jsp:include page="/menu.jsp"></jsp:include>
    <div class="container-fluid main-content">
        <div class="row">
            <div class="col-md-9 col-sm-9">
                <div class="widget-container fluid-height clearfix">
                    <div class="heading clearfix">
                        <i class="icon-table"></i> 出入库
                        <a href="javascript:;" class="pull-right" onclick="history.go(-1);"><i
                                class="icon-reply"></i></a>
                    </div>
                    <div class="widget-content padded clearfix">
                        <div id="w0" class="grid-view">
                            <div class="table-responsive">
                                <table class="table table-hover">
                                    <thead>
                                    <tr>
                                        <th nowrap>编号</th>
                                        <th nowrap>主题</th>
                                        <th nowrap>客户</th>
                                        <th nowrap>总金额</th>
                                        <th nowrap>下单时间</th>
                                        <th nowrap>制单人</th>
                                        <th nowrap>创建时间</th>
                                        <th class="action-column">操作</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <c:forEach items="${orders}" var="orders">
                                    <tr data-key="6">
                                        <td><a href="sales/prevprint.html?id=6" target="_blank">${orders.orderId}</a></td>
                                        <td><a href="sales/prevprint.html?id=6" target="_blank">${orders.title}</a></td>
                                        <td><a href="customer/view.html?id=1" target="_blank">${orders.customer.cusName}</a></td>
                                        <td>${orders.ordersDetail.realTotalPrice}</td>
                                        <td>${orders.orderTime}</td>
                                        <td>${orders.employee.employeeName}</td>
                                        <td>${orders.createTime}</td>
                                        <c:if test="${orders.status==3}">
                                        <td><span>已出库 </span></td>
                                        </c:if>
                                            <c:if test="${orders.status==2}">
                                                <td><span>待出库 </span></td>
                                            </c:if>
                                                <c:if test="${orders.status==1}">
                                                    <td><span>已入库 </span></td>
                                                </c:if>


                                        <td><span><a  onclick="examine('${orders.orderId}')"
                                                     title="更新">状态变更 </a></span></td>

                                    </tr>
                                    </c:forEach>

                                    </tbody>
                                </table>
                            </div>
                            <div class="datatable-footer">
                                <div class="dataTables_info">
                                    <div class="pull-left">第<b>1-2</b>条，共<b>2</b>条数据.</div>
                                </div>
                                <div class="dataTables_paginate paging_full_numbers"></div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-md-3 col-sm-3">
                <div class="list-group">
                    <a href="${pageContext.request.contextPath}/orders/list" class="list-group-item active">
                        <p>全部</p>
                    </a>
                    <a href="${pageContext.request.contextPath}/orders/list?" class="list-group-item  ">
                        <p>等待入库</p>
                    </a>
                    <a href="${pageContext.request.contextPath}/orders/list?status=1" class="list-group-item  ">
                        <p>已入库单</p>
                    </a>
                    <a href="${pageContext.request.contextPath}/orders/list?status=2" class="list-group-item  ">
                        <p>等待出库</p>
                    </a>
                    <a href="${pageContext.request.contextPath}/orders/list?status=3" class="list-group-item  ">
                        <p>已出库单</p>
                    </a>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    function examine(id) {
        location.href='${pageContext.request.contextPath}/orders/updateView?id='+id;
    }
</script>

</body>

</html>
